<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    function __destruct(){                                                                         // 析构方法  写入用户访问和操作日志
       // require '/home/wwwroot/default/world/behavior.php';
       require 'behavior.php';
    }
	// 主页
	public function index() {
		
		// 公告栏
		$notice = M ( 'notice' );
		$noticeInfo = $notice->limit ( 1 )->order ( "adddate desc" )->select ();
		$this->assign ( 'noticeInfo', $noticeInfo );
		
		// 最新创意
		$ideas = M ( 'ideas' );
		$ideasInfo = $ideas->limit ( 7 )->order ( "idate desc" )->select ();
		$this->assign ( 'ideasInfo', $ideasInfo );
		
		// 最新项目
		$project = M ( 'project' );
		$projectInfo = $project->where ( 'ischecked=1' )->limit ( 7 )->order ( "adddate desc" )->select ();
		$this->assign ( 'projectInfo', $projectInfo );
		
		// 最新新闻
		$news = M ( 'news' );
		$newsInfo = $news->limit ( 7 )->order ( "dtime desc" )->select ();
		$this->assign ( 'newsInfo', $newsInfo );
		
		$this->display ();
	}
	
	// ueditor
	public function ueditor() {
		$data = new \Org\Util\Ueditor ();
		echo $data->output ();
	}
}